(1) Field of the Invention
The present invention relates to a technology for saving data from a register to a stack memory in response to call of functions.
(2) Related Art
In calling another function during execution of a function, a computer saves to its stack memory such things as the address of the function currently executed, and data retained in its register. Upon termination of execution of the called function, the computer restores the saved data from the stack memory to the register, and returns the process to the address restored from the stack memory.
However, if all the registers are to be saved, it will increase the number of cycles and the capacity of the stack memory that are required for saving them. This will lead to a deterioration of the system performance.
In view of reducing the number of cycles required for calling a function, a Japanese Laid-open Patent application H08-305581 discloses a program conversion apparatus and a processor, by which call subroutines disposed in different files are called from the calling routines, without causing disorder to the pipelines.
In view of reducing the capacity of stack memory required for saving, there has already been a technology for reducing the number of registers to be saved, by targeting only a guaranteed register which requires the values to be guaranteed before and after another function is called. One example thereof is a U.S. Pat. No. 5241679. which discloses a technology for selectively specifying registers to be saved to a stack memory.
These days, as programs become large in scale, the number of registers owned by a processor tends to increase as well. Accordingly, even for saving only the guaranteed registers to a stack memory, the amount of data to be saved will be large. In view of this, it is an issue to mount a large-capacity stack memory to a processor, for avoiding overflow at the stack memory.